package com.huipinche.dao.impl;

import com.huipinche.dao.JourneyFormDao;
import com.huipinche.dao.bean.JourneyForm;

import java.util.ArrayList;
import java.util.List;

/**
 * @Auther: 王勇杰/张凯霄
 * @Date:
 * @Description:
 */
public class JourneyFormDaoimpl implements JourneyFormDao {
    static List<JourneyForm>journeyformDate;
    static int id = 0;
    static {
        journeyformDate  = new ArrayList<>();


    }

    @Override
    public int insertJourneyForm(JourneyForm journeyform) {
        id++;
        journeyform.setId(id);
        journeyformDate.add(journeyform);
        return 1;
    }

    @Override
    public List<JourneyForm> getJourneyFormByJfid(int jfid) {
        List<JourneyForm> journeyforms = new ArrayList<>();
        for(int i=0;i<journeyformDate.size();i++ ){
            if(journeyformDate.get(i).getId()==jfid){
                journeyforms.add(journeyformDate.get(i));
            }
            return journeyforms;
        }
        return null;
    }
}
//题外话：学习这件东西是痛苦的，但是
